
from queue import Queue
import myclient
############通信#####################################
def RaspInit():
    global myRaspConnection
    #172.27.119.154  笔记本
    #120.46.171.197  云服务器
    #192.168.8.7  台式机
    #127.0.1.1
    #49.233.245.232
    #myRaspConnection = myclient.connect_Raspberry('120.46.171.197', 8888)
    myRaspConnection = myclient.connect_Raspberry('49.233.245.232', 8888)


def Get_Rasp():
    global myRaspConnection
    return myRaspConnection
####flag############################################
def flag_init():
    global flag
    flag = True
def flag_set(val):
    global flag
    flag = val
def get_flag():
    return flag
####手势###########################################
def hand_queue_init():
    global HandGesture
    global HandImage
    HandGesture = Queue(1)  # 传输姿态
    HandImage = Queue(2)  # 接受姿态图片
def get_hand_gesture():
    return HandGesture
def put_hand_gesture(val):
    HandGesture.put(val)
def pop_hand_gesture():
    return HandGesture.get()
def get_hand_image():
    return HandImage
def put_hand_image(val):
    HandImage.put(val)
def pop_hand_image():
    return HandImage.get()
####人脸###########################################
def face_queue_init():
    global FaceImage
    global FaceName
    FaceImage = Queue(2)  # 传输人脸图像
    FaceName = Queue(1)
# def for_NAME(val):
#     global NAME
#     NAME = val
# def get_NAME():
#     return NAME
def get_face_image():
    return FaceImage
def put_face_image(val):
    FaceImage.put(val)
def pop_face_image():
    return FaceImage.get()
def get_face_name():
    return FaceName
def put_face_name(val):
    FaceName.put(val)
def pop_face_name():
    return FaceName.get()
####身份##########################################
def identify_init():
    global IdentityInform
    IdentityInform = Queue(1)
def get_identify():
    return IdentityInform
def put_identify(val):
    IdentityInform.put(val)
def pop_identify():
    return IdentityInform.get()
####dec#########################################
def dec_init():
    global dec
    dec = 0
def dec_set(val):
    global dec
    dec = val
def get_dec():
    return dec